﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Wfrm_ConsultarSolicitud.aspx.vb" Inherits="WebCompras.Wfrm_ConsultarSolicitud" %>

<%@ Register assembly="Anthem" namespace="Anthem" tagprefix="anthem" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    
    <title></title>
    
          
  		<link href="Css/Hoja.css" rel="stylesheet" type="text/css" />
		
		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> 
		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script> 

		<link href="../css/jquery-ui-1.7.2.custom.css" rel="stylesheet" type="text/css" />

		<link href="../css/default.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript">

         function ValidNum(e) {
             var tecla = document.all ? tecla = e.keyCode : tecla = e.which;
             return ((tecla > 47 && tecla < 58) || tecla == 46);
         }
	</script>
    
    
    <script>

$(function () 
{
 
    $('#txtStartDate, #txtEndDate').datepicker(
    {
     closeText: 'Cerrar',
     prevText: '&#x3c;Ant',
     nextText: 'Sig&#x3e;',
     currentText: 'Hoy',
     monthNames: ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio',
	'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'],
    monthNamesShort: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun',
	'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'],
    dayNames: ['Domingo', 'Lunes', 'Martes', 'Mi&eacute;rcoles', 'Jueves', 'Viernes', 'S&aacute;bado'],
    dayNamesShort: ['Dom', 'Lun', 'Mar', 'Mi&eacute;', 'Juv', 'Vie', 'S&aacute;b'],
    dayNamesMin: ['Do', 'Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'S&aacute;'],
    buttonImageOnly: true,
    weekHeader: 'Sm',
    dateFormat: 'dd/mm/yy',
    firstDay: 1, 
    changeYear: true,
    changeMonth: true,
    yearRange: '-30:+10'   //RANGO DE AO
    })
        
})
 
function customRange(input) 
{ 
    var min = new Date(2008, 11 - 1, 1); //Set this to your absolute minimum date
        var dateMin = min;
        var dateMax = null;
        var dayRange = 6;  // Set this to the range of days you want to restrict to
    
        
        if (input.id == "txtStartDate") 
        {
            if ($("#txtEndDate").datepicker("getDate") != null)
            {
                dateMax = $("#txtEndDate").datepicker("getDate");
                dateMin = $("#txtEndDate").datepicker("getDate");
                dateMin.setDate(dateMin.getDate() - dayRange);
                if (dateMin < min)
                {
                        dateMin = min;
                }
             }
             else
             {
                dateMax = new Date(); 
             }                      
        }
        else if (input.id == "txtEndDate")
        {
                dateMax = new Date(); 
                if ($("#txtStartDate").datepicker("getDate") != null) 
                {
                        dateMin = $("#txtStartDate").datepicker("getDate");
                        var rangeMax = new Date("<%= now.year %>", "<%= now.month %>", "<%= now.day %>");
                        var aniofinal = d.getFullYear();
                        var anioinicio = d.getFullYear() - 120;
                        var fechaactual = d.getDate();
                     
                        
                        if(rangeMax < dateMax)
                        {
                            dateMax = rangeMax; 
                        }
                }
        }
    return {
                minDate: dateMin, 
                maxDate: dateMax,
            } 
 
}
 
</script> 
     
    
</head>

<body contextmenu="false">
    <form id="form1" runat="server">
    
   <table width ="100%">
            <tr>
                <td>
                    <table align="left">
                        
                        <tr>
                            <td align="left" style="width: 1107px">
                                <img id="IMG1" align="bottom" border="0" src="../img/titulos_consultar_Solicitud.png" /></td>
                            
                        </tr>
                        
                        <tr>
                            <td align="left" style="width: 1107px">
<%--            <anthem:LinkButton ID="linkSolicitud" runat="server" CssClass="lables01" 
                                    EnabledDuringCallBack="False">Busqueda de Solicitudes</anthem:LinkButton>--%>
						    </td>
                        </tr>
                        
                        <tr>
                            <td align="left" style="width: 1107px;">
                                <table  border="1" bordercolor="gainsboro" cellpadding="1" cellspacing="0" style="width: 469px">
                                    <tr>
                                        <td style="width: 45px">
                                                            <anthem:Label ID="lblSolicitud8" runat="server" Text="Clínica" 
                                                                CssClass="lables01"></anthem:Label>
                                                        </td>
                                        <td style="width: 183px">
                                                            <anthem:Label ID="lbl_clinica" runat="server" 
                                                                CssClass="lables01"></anthem:Label>
                                                        </td>
                                        <td style="width: 37px">
                                                            <anthem:Label ID="lblSolicitud7" runat="server" Text="Fecha" 
                                                                CssClass="lables01"></anthem:Label>
                                                        </td>
                                        <td colspan="3">
                                                            <anthem:Label ID="lbl_fecha" runat="server" 
                                                                CssClass="lables01"></anthem:Label>
                                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 45px">
                                                            <anthem:Label ID="lblSolicitud9" runat="server" Text="Usuario" 
                                                                CssClass="lables01"></anthem:Label>
                                                        </td>
                                        <td style="width: 183px">
                                                            <anthem:Label ID="lbl_usuario" runat="server" 
                                                                CssClass="lables01"></anthem:Label>
                                                        </td>
                                        <td style="width: 37px">
                                            <anthem:Label ID="lblSolicitud10" runat="server" Text="N Sol." 
                                                                CssClass="lables01"></anthem:Label></td>
                                        <td style="width: 99px">
                                                            <anthem:Label ID="lbl_nro_solicitud" runat="server" 
                                                                CssClass="lables01"></anthem:Label></td>
                                        <td style="width: 42px">
                                                            <anthem:Label ID="lblSolicitud11" runat="server" Text="N° Prod." 
                                                                CssClass="lables01"></anthem:Label></td>
                                        <td>
                                                            <anthem:Label ID="lbl_nro_productos" runat="server" 
                                                                CssClass="lables01"></anthem:Label>
                                        </td>
                                    </tr>
                                </table>
						    </td>
						        <td style="height: 54px">
                                
                                </td>
                        </tr>
                        <tr>
                            <td align="left" style="width: 1107px">
                                <table   border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td align="left" >
                                <anthem:Panel ID="Panel1" runat="server" >
                                    <table style="width: 362px">
                                        <tr>
                                            <td align="center" valign="top"  >
                                            <anthem:Panel ID="pnl_buscar" runat="server" BorderColor="#666666" 
                                                    BorderStyle="Solid" BorderWidth="2px">
                                                <table style="width: 292px">
                                                    <tr>
                                                        <td align="left" style="height: 30px">
                                                             <anthem:Label ID="Nsolicitud" runat="server" CssClass="lables01" 
                                                                Text="N° Sol. Inicial:" Width="78px"></anthem:Label>
                                                        </td>
                                                        <td style="height: 30px">
                                                           <anthem:TextBox ID="txtNsolicitud" runat="server" AutoComplete="off" 
                                                                Width="70px" Height="13px"></anthem:TextBox>
                                                        </td>
                                                        <td style="height: 30px">
                                                            <anthem:Label ID="Nsolicitud0" runat="server" CssClass="lables01" 
                                                                Text="N° Sol. Final:" Width="78px"></anthem:Label>
                                                          </td>
                                                        <td style="height: 30px" align="left">
                                                            <anthem:TextBox ID="txtNsolicitud0" runat="server" AutoComplete="off" 
                                                                Height="13px" Width="70px"></anthem:TextBox>
                                                            </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="left">
                                                            <anthem:Label ID="FechaDesde" runat="server" CssClass="lables01" 
                                                                Text="Fecha Desde:"></anthem:Label>
                                                        </td>
                                                        <td>
                                                            <anthem:TextBox ID="txtStartDate" runat="server" AutoComplete="off" 
                                                                Width="70px" Height="13px"></anthem:TextBox>
                                                        </td>
                                                        <td>
                                                            <anthem:Label ID="FechaHasta" runat="server" CssClass="lables01" 
                                                                Text="Fecha Hasta:" Width="67px"></anthem:Label>
                                                        </td>
                                                        <td align="left">
                                                            <anthem:TextBox ID="txtEndDate" runat="server" AutoComplete="off" Width="70px" Height="13px"></anthem:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="left">
                                                            <anthem:Label ID="FechaDesde0" runat="server" CssClass="lables01" 
                                                                Text="Estado:"></anthem:Label>
                                                        </td>
                                                        <td colspan="3" align="left">
                                                            <anthem:DropDownList ID="cmb_estado_solicitud" runat="server" 
                                                                CssClass="DropDownlist01" Height="23px" style="margin-left: 0px" Width="225px">
                                                            </anthem:DropDownList>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            &nbsp;</td>
                                                        <td>
                                                            &nbsp;</td>
                                                        <td>
                                                            &nbsp;</td>
                                                        <td>
                                                            <anthem:ImageButton ID="btnBuscaSol" runat="server" 
                                                                ImageUrl="~/paginas/imagenes/boton_BUSCAR_2.png" 
                                                                ImageUrlDuringCallBack="../images/loading.gif" />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            &nbsp;</td>
                                                        <td>
                                                            &nbsp;</td>
                                                        <td>
                                                            &nbsp;</td>
                                                        <td>
                                                            &nbsp;</td>
                                                    </tr>
                                                </table>
                                                </anthem:Panel>
                                            </td>
                                            <td class="style6" style="width: 102px" rowspan="2">
                                                <table style="width: 100%">
                                                    <tr>
                                                        <td>
                                                            <anthem:Panel ID="Panel2" runat="server" CssClass="Paneles" Width="430px" 
                                                                Visible="False">
                                                                <table cellpadding="0" cellspacing="0" width="900px">
                                                                    <tr>
                                                                        <td align="left">
                                                                            <table style="width: 392px">
                                                                                <tr>
                                                                                    <td align="left" class="style4" style="width: 84px">
                                                                                        <anthem:Label ID="lblSolicitud" runat="server" CssClass="lables01" 
                                                                                            Text="N° Solicitud" Width="71px"></anthem:Label>
                                                                                    </td>
                                                                                    <td align="left" class="style2">
                                                                                        <anthem:TextBox ID="txtSolicitud" runat="server" ReadOnly="TRUE" Width="60px" 
                                                                                            Enabled="False" Height="13px"></anthem:TextBox>
                                                                                    </td>
                                                                                    <td align="left" class="style2">
                                                                                        <anthem:DropDownList ID="cmbProducto" runat="server" CssClass="DropDownlist01" 
                                                                                            Enabled="False" Height="18px" style="margin-left: 0px" Visible="False" 
                                                                                            Width="24px">
                                                                                        </anthem:DropDownList>
                                                                                        <anthem:RadioButtonList ID="Rad_orden" runat="server" AutoCallBack="True" 
                                                                                            EnabledDuringCallBack="False" Font-Names="Arial" Font-Size="11px" 
                                                                                            RepeatDirection="Horizontal" TextDuringCallBack="Cargando..." Visible="False">
                                                                                            <Items>
                                                                                                <asp:ListItem Selected="True" Value="tnombre1">Nom.</asp:ListItem>
                                                                                                <asp:ListItem Value="tProducto">Cod.</asp:ListItem>
                                                                                            </Items>
                                                                                        </anthem:RadioButtonList>
                                                                                        <anthem:TextBox ID="txtCantidad" runat="server" AutoComplete="off" 
                                                                                            ControlToValidate="num" Enabled="False" Height="13px" MaxLength="6" 
                                                                                            ValidationExpression="^[1-9]+\d*$" Visible="False" Width="77px"></anthem:TextBox>
                                                                                    </td>
                                                                                </tr>
                                                                                <tr>
                                                                                    <td align="left" class="style4" style="width: 84px">
                                                                                        <anthem:Label ID="lblBodega" runat="server" CssClass="lables01" 
                                                                                            Text="Bodega Destino" Width="81px"></anthem:Label>
                                                                                    </td>
                                                                                    <td align="left" class="style2">
                                                                                        <anthem:DropDownList ID="cmbBodega" runat="server" CssClass="DropDownlist01" 
                                                                                            Height="22px" Width="230px" Enabled="False">
                                                                                        </anthem:DropDownList>
                                                                                    </td>
                                                                                    <td align="left" class="style2">
                                                                                        &nbsp;</td>
                                                                                </tr>
                                                                            </table>
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </anthem:Panel>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <anthem:Label ID="lblSolicitud0" runat="server" CssClass="lables01" 
                                                                Text="Listado de Productos de la Solicitud" Visible="False"></anthem:Label>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <anthem:Panel ID="pnl_productos" runat="server" CssClass="Paneles" 
                                                                Height="177px" Width="392px" ScrollBars="Vertical" Visible="False">
                                                                <table border="0" cellpadding="0" cellspacing="0">
                                                                    <tr>
                                                                        <td align="left">
                                                                            <anthem:DataGrid ID="DataGrid2" runat="server" AllowCustomPaging="True" 
                                                                                AutoGenerateColumns="False" BackColor="White" BorderColor="#8298B7" 
                                                                                BorderStyle="None" BorderWidth="1px" CellPadding="2" class="titgrillatd" 
                                                                                Font-Names="Arial,Helvetica,sans-serif" Font-Size="11px" ForeColor="Black" 
                                                                                HorizontalAlign="Left" PageSize="5" Width="300px">
                                                                                <FooterStyle BorderColor="#8298B7" BorderStyle="Groove" Font-Bold="False" 
                                                                                    Font-Italic="False" Font-Overline="False" Font-Strikeout="False" 
                                                                                    Font-Underline="False" HorizontalAlign="Left" />
                                                                                <EditItemStyle BackColor="White" BorderColor="#8298B7" Font-Size="11px" 
                                                                                    HorizontalAlign="Left" />
                                                                                <SelectedItemStyle BackColor="White" BorderColor="#8298B7" Font-Bold="True" 
                                                                                    Font-Size="11px" />
                                                                                <PagerStyle BackColor="White" BorderColor="#8298B7" Font-Size="11px" />
                                                                                <AlternatingItemStyle BackColor="#E6E3E3" BorderColor="#8298B7" 
                                                                                    BorderStyle="Solid" BorderWidth="1px" Font-Names="Arial,Helvetica,sans-serif" 
                                                                                    Font-Size="11px" HorizontalAlign="Left" />
                                                                                <ItemStyle BorderColor="#8298B7" Font-Names="Arial,Helvetica,sans-serif" 
                                                                                    Font-Size="11px" ForeColor="#3B3C3C" HorizontalAlign="Left" />
                                                                                <HeaderStyle BackColor="#D0DAE6" BorderColor="#8298B7" BorderStyle="Solid" 
                                                                                    BorderWidth="1px" Font-Bold="False" Font-Italic="False" Font-Overline="False" 
                                                                                    Font-Strikeout="False" Font-Underline="False" ForeColor="#3B3C3C" 
                                                                                    HorizontalAlign="Center" />
                                                                                <Columns>
                                                                                    <asp:TemplateColumn Visible="False">
                                                                                        <ItemTemplate>
                                                                                            <anthem:ImageButton ID="Eliminar" OnClientClick="return confirm('�Confirma eliminar?')" runat="server" CommandName="Select" 
                                                                                                EnabledDuringCallBack="False" ImageUrl="../Iconos/delete.gif" />
                                                                                        </ItemTemplate>
                                                                                        <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" 
                                                                                            Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center" />
                                                                                    </asp:TemplateColumn>
                                                                                    <asp:BoundColumn DataField="nCodigo_PKI" HeaderText="nCodigo_PKI" 
                                                                                        Visible="False"></asp:BoundColumn>
                                                                                    <asp:BoundColumn DataField="tNombre" HeaderText="Producto" Visible="False">
                                                                                    </asp:BoundColumn>
                                                                                    <asp:BoundColumn DataField="tNombre" HeaderText="Producto">
                                                                                        <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" 
                                                                                            Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Left" />
                                                                                    </asp:BoundColumn>
                                                                                    <asp:TemplateColumn HeaderText="Cantidad">
                                                                                        <ItemTemplate>
                                                                                            <asp:Label ID="Label5" runat="server" 
                                                                                                Text='<%# FormatNumber(DataBinder.Eval(Container, "DataItem.CANT_SOLICITADA") ,0)%>'></asp:Label>
                                                                                        </ItemTemplate>
                                                                                    </asp:TemplateColumn>
                                                                                </Columns>
                                                                            </anthem:DataGrid>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td align="center">
                                                                            <br />
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </anthem:Panel>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <table ID="Table1" border="0" cellpadding="0" cellspacing="0" 
                                                                style="width: 392px">
                                                                <tr>
                                                                    <td align="center">
                                                                        <anthem:ImageButton ID="Img_Imprimir" runat="server" EnableCallBack="False" 
                                                                            ImageUrl="~/Paginas/imagenes/boton_IMPRIMIR.png" 
                                                                            ImageUrlDuringCallBack="../images/loading.gif" Visible="False" />
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            &nbsp;</td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            &nbsp;</td>
                                                    </tr>
                                                </table>
                                            </td>
                                         </tr>
                                        <tr>
                                            <td  align="center" valign="top">
                                                <anthem:Panel ID="Panel3" runat="server" Height="192px" ScrollBars="Auto" 
                                                    Width="339px">
                                                    <anthem:DataGrid ID="DataGrid1" runat="server" AllowSorting="True" 
                                                        AutoGenerateColumns="False" BackColor="White" BorderColor="#8298B7" 
                                                        BorderStyle="None" BorderWidth="1px" CellPadding="5" class="titgrillatd" 
                                                        Font-Names="Arial,Helvetica,sans-serif" Font-Size="11px" ForeColor="Black" 
                                                        HorizontalAlign="Left" PageSize="7" Width="335px">
                                                        <FooterStyle BorderColor="#8298B7" BorderStyle="Groove" Font-Bold="False" 
                                                            Font-Italic="False" Font-Overline="False" Font-Strikeout="False" 
                                                            Font-Underline="False" HorizontalAlign="Left" />
                                                        <EditItemStyle BackColor="White" BorderColor="#8298B7" Font-Size="11px" 
                                                            HorizontalAlign="Left" />
                                                        <SelectedItemStyle BackColor="White" BorderColor="#8298B7" Font-Bold="True" 
                                                            Font-Size="11px" />
                                                        <PagerStyle BackColor="White" BorderColor="#8298B7" Font-Size="11px" />
                                                        <AlternatingItemStyle BackColor="#E6E3E3" BorderColor="#8298B7" 
                                                            BorderStyle="Solid" BorderWidth="1px" Font-Names="Arial,Helvetica,sans-serif" 
                                                            Font-Size="11px" HorizontalAlign="Left" />
                                                        <ItemStyle BorderColor="#8298B7" Font-Names="Arial,Helvetica,sans-serif" 
                                                            Font-Size="11px" ForeColor="#3B3C3C" HorizontalAlign="Left" />
                                                        <HeaderStyle BackColor="#D0DAE6" BorderColor="#8298B7" BorderStyle="Solid" 
                                                            BorderWidth="1px" Font-Bold="False" Font-Italic="False" Font-Overline="False" 
                                                            Font-Strikeout="False" Font-Underline="False" ForeColor="#3B3C3C" 
                                                            HorizontalAlign="Center" />
                                                        <Columns>
                                                            <asp:TemplateColumn HeaderText="N° Solicitud"  SortExpression="ID_SOLICITUD">
                                                                <ItemTemplate>
                                                                    <anthem:LinkButton ID="LinkButton2" runat="server" CommandName="select" 
                                                                        EnabledDuringCallBack="False" 
                                                                        Text='<%# DataBinder.Eval(Container, "DataItem.ID_SOLICITUD") %>' 
                                                                        TextDuringCallBack="Cargando..."></anthem:LinkButton>
                                                                </ItemTemplate>
                                                            </asp:TemplateColumn>
                                                            <asp:BoundColumn DataField="FECHA_CREACION" HeaderText="Fecha" 
                                                                SortExpression="FECHA_CREACION">
                                                                <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" 
                                                                    Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center" />
                                                            </asp:BoundColumn>
                                                            <asp:BoundColumn DataField="DESCRIPCION" HeaderText="Bodega" 
                                                                SortExpression="DESCRIPCION">
                                                                <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" 
                                                                    Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Left" />
                                                            </asp:BoundColumn>
                                                            <asp:BoundColumn DataField="ID_BODEGA" HeaderText="ID_BODEGA" Visible="False">
                                                            </asp:BoundColumn>
                                                            <asp:BoundColumn DataField="ESTADO_SOL" HeaderText="ESTADO_SOL" Visible="False">
                                                            </asp:BoundColumn>
                                                            <asp:BoundColumn DataField="TEstado" HeaderText="Estado" 
                                                                SortExpression="TEstado"></asp:BoundColumn>
                                                        </Columns>
                                                    </anthem:DataGrid>
                                                </anthem:Panel>
                                                <br />
                                            </td>
                                        </tr>
                                    </table>                                   
                                </anthem:Panel>
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                         <br />
                                         </td>
                            </tr>
                            </table>
						    </td>
                        </tr>
                        </table>
                </td>
            </tr>
        </table>
    </form>
</body>
</html>